package org.anyline.simple.datasource.controller;

import com.baomidou.dynamic.datasource.annotation.DS;
import org.anyline.entity.DataSet;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller("web.home.DefaultController")
@RequestMapping("/")
public class DefaultController extends BasicController {
    @RequestMapping("list")
    @ResponseBody
    @DS("master")
    public String list() {
        DataSet set = service.querys("crm_user", condition(true));
        service.metadata().table("crm_user");
        service.metadata().tables();
        return success(set);
    }

    @RequestMapping("list_pg")
    @ResponseBody
    @DS("pg")
    public String list_pg() {
        DataSet set = service.querys("crm_user", condition(true));
        service.metadata().table("crm_user");

        service.metadata().tables();
        return success(set);
    }
    @RequestMapping("list_ms")
    @ResponseBody
    @DS("ms")
    public String list_ms() {
        DataSet set = service.querys("crm_user", condition(true));
        service.metadata().table("crm_user");

        service.metadata().tables();
        return success(set);
    }
}
